//
//  SPMineCollectionViewCell.swift
//  Swift-demo
//
//  Created by zcp on 2021/9/28.
//

import UIKit

class SPMineCollectionViewCell: SPBaseCollectionViewCell {
    
    private lazy var iconView: UIImageView = {
        let iw = UIImageView()
        iw.contentMode = .scaleAspectFit
        return iw
    }()
    
    private lazy var titleL: UILabel = {
        let tl = UILabel()
        tl.textAlignment = .center
        tl.font = UIFont.systemFont(ofSize: 14)
        tl.textColor = .black
        return tl
    }()
    
    override func initUI() {
        
        contentView.addSubview(iconView)
        iconView.snp.makeConstraints { make in
            make.left.right.equalToSuperview()
            make.top.equalTo(10)
            make.height.equalTo(contentView.snp.width).multipliedBy(0.5)
        }
        contentView.addSubview(titleL)
        titleL.snp.makeConstraints { make in
            make.left.right.bottom.equalToSuperview()
            make.top.equalTo(iconView.snp_bottom).offset(-15)
        }
    }
    
    open override func setData(dict: [String : Any], indexPath: NSIndexPath?) {
        iconView.image = UIImage(named: dict["icon"] as! String)
        titleL.text = dict["title"] as? String
    }
    
}
